package com.imooc.demo.utils;

import com.imooc.demo.vo.ResultVo;

public class ResultVoUtil {

    public static ResultVo success(Object object){
        ResultVo<Object> objectResultVo = new ResultVo<>();
        objectResultVo.setCode(0);
        objectResultVo.setMsg("成功");
        objectResultVo.setData(object);
        return objectResultVo;
    }


    public static  ResultVo success(){
        return success(null);
    }

    public static ResultVo error(Integer code,String msg){
        ResultVo<Object> objectResultVo = new ResultVo<>();
        objectResultVo.setCode(code);
        objectResultVo.setMsg(msg);
        return objectResultVo;
    }
}
